module StudentID (
    clk, reset, a, b, c, d, e, f, g, dp, pos
);
  parameter sim = 0;

  input clk, reset;
  output a, b, c, d, e, f, g, dp;
  output [3:0] pos;

  wire pulse400Hz, pulse2Hz;
  wire[51:0] id;
  
  // 循环移位器(shifter)
  shifter shifterInst(
    .ld(reset), .clk(clk), .en(pulse2Hz), .q(id)
  );

  // 分频器1(counter1) /250000
  counter_n #(.n(sim?4:250000), .counter_bits(sim?2:18)) counter1(
    .clk(clk), .en(1'b1), .r(1'b0), .q(), .co(pulse400Hz)
  );
  
  // 分频器2(counter2) /200
  counter_n #(.n(sim?16:200), .counter_bits(sim?4:8)) counter2(
    .clk(clk), .en(pulse400Hz), .r(1'b0), .q(), .co(pulse2Hz)
  );

  // 动态显示模块
  display displayInst(
    .clk(clk), .scan(pulse400Hz),
    .d0(id[39:36]), .d1(id[43:40]), .d2(id[47:44]), .d3(id[51:48]),
    .a(a), .b(b), .c(c), .d(d), .e(e), .f(f), .g(g),
    .pos(pos)
  );
  assign dp = 1;

    
endmodule